package API.RuntimeAPI;

public class AboutMemory {
    public static void main(String[] args) {
        //JVM能从系统中获取的总内存大小
        System.out.println((Runtime.getRuntime().maxMemory()/Math.pow(1024, 3)) + " GB");
        //JVM已从系统中获取的总内存大小
        System.out.println((Runtime.getRuntime().totalMemory()/Math.pow(1024, 3)) + " GB");
        //JVM剩余的内存大小
        System.out.println((Runtime.getRuntime().freeMemory()/Math.pow(1024, 3)) + " GB");
    }
}
